package com.htsk.city.services.core.dao;

import com.htsk.city.services.core.domain.Role;
import com.htsk.city.services.core.domain.SysUserRole;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * (SysUserRole)表数据库访问层
 *
 * @author makejava
 * @since 2024-09-25 18:13:08
 */
public interface SysUserRoleDao extends JpaRepository<SysUserRole,Integer> {
    @Query(value = "select r.* from sys_user_role ur left join role r on ur.role_id=r.id where ur.user_id=?1 and r.del_flag=0",nativeQuery = true)
    List<Role> queryByUser(Integer userId);
}

